<script setup lang="ts">
	import { Button } from 'ant-design-vue'
	import { useStore } from './store'
	import $api from '@/service/webRequest'
	import { APIs } from '@/service/apiList'
	const store = useStore()

	const changeName = () => {
		store.setName('张三')
	}
	$api
		.getUserInfo()
		.then((res) => {
			console.log(res)
		})
		.catch((err) => {
			console.log(err)
		})

	$api
		.get(APIs.login)
		.then((res) => {
			console.log(res)
		})
		.catch((err) => {
			console.log(err)
		})
</script>

<template>
	<div class="text-[red] text-3xl">HelloWorld</div>
	<Button @click="changeName">{{ store.name }}</Button>
	<Button @click="$i18n.locale = 'zh'">切换为中文</Button>
	<Button @click="$i18n.locale = 'en'">切换为英文</Button>
	<router-view></router-view>
</template>

<style scoped></style>
